package com.bocaizp.operation.mapper;

import com.bocaizp.pojo.DTO.GoodJobDTO;
import com.bocaizp.pojo.DTO.PositionDirectionDTO;
import com.bocaizp.pojo.DTO.PositionFatherDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Author : huang jie
 * Date : 2024/5/6 22:30
 **/
@Mapper
public interface HomeMapper {

	/**
	 * 获取所有行业信息
	 * @return
	 */
	@Select("select father from position group by father")
	List<PositionFatherDTO> getfather();

	/**
	 * 根据行业获取职位方向
	 * @param father
	 * @return
	 */
	@Select("select direction from position where father = #{father} group by direction")
	List<PositionDirectionDTO> getDirection(String father);

	/**
	 * 根据方向获取具体职位
	 *
	 * @param direction
	 * @param father
	 * @return
	 */
	@Select("select name from position where direction = #{direction} and father = #{father}")
	List<String> getName(@Param("direction") String direction,@Param("father") String father);

	/**
	 * 选择16个热门行业
	 * @return
	 */
	@Select("select father from position group by father limit 0,16")
	List<String> getindustry();

	/**
	 * 指定行业最火热的职位
	 *
	 * @param in
	 * @return
	 */
	@Select("select job,salary_bottom,salary_top,salary_month,degrees,city,logo,company from job_data where industry = #{in} order by hot desc limit 0,1")
	GoodJobDTO getHotJob(String in);
}
